﻿<?php
define('IN_QY',true);
session_start();
require("include/common.inc.php");
header("Content-type: text/html; charset=utf-8");
include_once('dependency/WxPayPubHelper/WxPayPubHelper.php');
require_once("include/config.php");
require_once("include/httpUtil.php");
define('SCRIPT','ad_list');

if(!$_COOKIE['userid']){
	echo "<script type='text/javascript'>location.href='mlogin.php';</script>";
	exit;
}
//刷 vip金额
	  $sqlsdan = "select * from tbl_shuadan  where uid='".$_COOKIE['userid']."'";
      $querysdan=mysql_query($sqlsdan);
      $rowsdan=mysql_fetch_array($querysdan);
if(!$rowsdan){
	
	$shuadan=rand(199,999);
	$scang=rand(55,80);	
	$dianji=rand(1000,2000);		
	$sql = "insert into
	 tbl_shuadan
	  values (
	  	0,
	  	'".$_COOKIE['userid']."',
		'".$scang."',
		'".$shuadan."',
		'".$dianji."'		
		)";
	mysql_query($sql);	
}
//

$sql="select * from tbl_user where id=".$_COOKIE['userid'];
$a=mysql_query($sql);
$rowa=mysql_fetch_array($a);
//
$sql1="select * from tbl_shuadan where uid=".$_COOKIE['userid'];
$b=mysql_query($sql1);
$rowb=mysql_fetch_array($b);
//

$sqlvip = "select * from tbl_vip_record where uid='".$_COOKIE['userid']."' order by id desc limit 1 ";
$queryvip=mysql_query($sqlvip);
$rowvip=mysql_fetch_array($queryvip);	
$huiyaundaoqi =$rowvip['end_vip_date'];	
$zero1=date("y-m-d");
 if(strtotime($zero1)<strtotime($huiyaundaoqi)){	

$daoqi=1;

 }

?>
<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title><?=$_COOKIE['shuyu']?>/成为VIP-众晒网</title>
    <link rel="stylesheet" type="text/css" href="/ui/css/Hui.css" />
	
<script src="/ui/layer/mobile/layer.js"></script>
    <style type="text/css">
    	.H-timeline, .H-timeline-dot, html, body {
		    background: #ffffff;
		}
         #header{width:100%; position:absolute; top:0;}
         #lis{width:100%; overflow: auto; position:absolute; top:45px;bottom:0px;}
         li{border:1px solid gray;margin-top:10px;padding:8px;}
        .mu .liSelected{background-color:#EECBAD;border-color:#EE7942;}
        #header{width:100%; position:absolute; top:0;}
        #footer{width:100%; position:absolute; bottom:0;}
        #main{width:100%; overflow: auto; position:absolute; top:43px;bottom:55px;}

			.layui-m-layerchild {
			    background-color: rgba(255, 255, 255, 0);
			    border: 0;
                box-shadow: 0 0 8px rgba(0, 0, 0, 0);
			}
			.touxiang{
                width: 90%;
                height: 120px;
                margin: -77px auto;
                position: inherit;
                margin-top: -100px;
                margin-left: 17px;
                z-index: 0;
                background: #fff;
                border-radius: 7px;
                background-color: rgba(255, 255, 255, 0.49);
            }
			.aui-flex-box {
                display: -webkit-box;
                display: -webkit-flex;
                display: flex;
                -webkit-box-align: center;
                -webkit-align-items: center;
                align-items: center;
                width: 100%;
                position: relative;
                /* box-shadow: 0 1px 12px #ddd; */
                margin: 0;
                height: 0;
                z-index: 1
            }
			.aui-flex-box-hd {
                margin-right: .8em;
                width: 60px;
                height: 60px;
                line-height: 60px;
                text-align: center;
                border-radius: 100%;
                margin-top: -190px;
                margin-left: 34px;
            }
			.aui-flex-box-hd img {
                width: 100%;
                max-height: 100%;
                vertical-align: top;
                border-radius: 100%;
                border: 2px solid #fff;
            }
            .aui-flex-box-bd h2 {
            font-weight: 400;
            font-size: 0.9rem;
            width: auto;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            word-wrap: normal;
            word-wrap: break-word;
            word-break: break-all;
            color: #333;
            padding-bottom: 10px;
        }
        .aui-flex-box-bd p {
            color: #1d1d1d;
            font-size: 0.6rem;
            line-height: 1.2;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 1;
        }	
        .aui-flex-box-bd h2 {
            font-weight: 400;
            font-size: 2rem;
            padding-bottom: 0px;
            width: 100px;
            text-overflow: ellipsis;
        }
        .aui-flex-box-bd {
            margin-top: -136px;
        }
        .qiandao {
            border-radius: 5px;
            width: 70px;
            background: #ffa200;
            border: 1px solid #ffa200;
            color: white;
            font-weight: 600;
            font-size: 12px;
            height: 25px;
        }
        .aui-flex-box-fr {
            width: 60px;
            margin-left: 15px;
            margin-top: -110px;
        }
        .aui-flex-box-hy{
            float: left;
            width: 90px;
            z-index: 2;
            position: inherit;
            margin-left: -240px;
            margin-top: -10px;
        }
         .aui-flex-box-jf{
                float: right;
                width: 90px;
                z-index: 2;
                position: inherit;
                margin-left: 60px;
                margin-top: -10px;
         }
         .H-header-title, .H-header .H-icon {
            height: 52px;
        }
        .H-header-title, .H-header .H-icon {
		    height: 44px;
		    color: black;
		}
		.H-header-title, .H-header .H-icon {
		    height: 44px;
		    color: black;
		}
		.touxiang button{
			width: 80%;
		    margin: 79px 36px;
		    position: inherit;
		    z-index: 5;
		    height: 40px;
		    background: #ffffff;
		    border-radius: 8px;
		    border: 0;
		    font-size: 16px;
		    font-weight: 600;
		    box-shadow: 3px 4px 5px #bfbfbf;
		}
		.H-channel-title.H-flexbox-horizontal.H-theme-background-color-white.H-vertical-middle.H-border-vertical-bottom-after{
			margin-top:30px;
		}
		.H-padding-8 {
          	padding: 0px;
          	width: 100%; 
		}
		li:hover {
		   background-color: #ffd046;
            border-color: #ffc821;
            background-image: url(ui/image/gxzt.png);
            background-repeat: no-repeat;
            background-size: 16px;
            background-position: 5px 14px;
		}
		.jiage{
			margin-right:15px;
			margin-top: -35px;
			color: #ffa200;
			font-size: 14px;
			float: right;
		}
		.H-theme-font-color-999 {
		    font-size: 12px;
		}
		#ull{
			margin:0 auto;
		}
		li{
			border: 1px solid #bdbdbd;
			border-radius: 10px;
		}
		.toubu{
			margin-left:15%;
			color: #ffc821;
			font-size: 18px;
			
		}
		button.H-button.H-width-100-percent.H-font-size-18.H-outline-none.H-padding-vertical-both-7.H-padding-horizontal-both-17.H-theme-background-color8.H-theme-font-color-white.H-theme-border-color8.H-theme-border-color8-click.H-theme-background-color8-click.H-theme-font-color8-click.H-border-radius-3{
			width: 90%;
		    float: right;
		    height: 40px;
		    margin-bottom: 5px;
		    margin-left: 17px;
		    border-radius: 25px;
		    box-shadow: 3px 4px 5px #bfbfbf;
		    background: -webkit-linear-gradient(left, #f2d9a1, #f6e6c2);
		    border: 0;
		    color: #000000;
		    font-size: 16px;
		    font-weight: 600;
		    line-height: 16px;
		}
        li {
            
           
            background-image: url(ui/image/wxz.png);
            background-repeat: no-repeat;
            background-size: 16px;
            background-position: 5px 14px;
        }
        span {
            margin-left: 9px;
        }
        .layui-m-layerchild.layui-m-anim-scale {
           height: 53%;
            width: 70%;
            background-size: 100%;
            background-position: 0px 0px;
        }
        .layui-m-layerbtn {
            display: box;
            display: -moz-box;
            display: -webkit-box;
            width: 78%;
            height: 36px;
            line-height: 50px;
            font-size: 0;
            border: 0;
            background-color: #f2f2f200;
            background-color: rgba(244, 245, 249, 0);
            margin: 0 auto;
            margin-top: 49px;
            text-align: center;
            line-height: 34px;
        }
        .layui-m-layercont {
            padding: 87px 30px;
            line-height: 22px;
            text-align: center;
            font-size: 20px;
            color: #ffa200;
            font-weight: 400;
        }
    </style>
</head>
<body class="H-flexbox-vertical" >
    <header class="H-header H-theme-background-color-white" id="header">
        <span tapmode="" onclick="H.closeWin();" class="H-icon H-position-relative H-display-inline-block H-float-left H-vertical-middle H-theme-font-color-white H-padding-horizontal-left-5 H-z-index-100"><i class="H-iconfont H-theme-font-color-black H-icon-arrow-left H-font-size-18 H-vertical-middle"></i></span>
        <div class="H-header-title H-center-all H-font-size-18 H-text-show-row-1 H-theme-font-color-black H-position-absolute H-width-100-percent H-theme-background-white">
            VIP会员
        </div>
    </header>
    <div id="lis" class="H-padding-8">

        <div style="width: 100%; height: 160px; margin: 0 auto; background: -webkit-linear-gradient(left, #ff9347, #ff5e00);"></div>
        <div class="aui-flex-box">
                <div class="aui-flex-box-hd">
                    <img src="<?=$rowa['username']?>" alt="">
                </div>
                <div class="aui-flex-box-bd">
                    <h2> <?=$rowa['shuyu']?></h2>
					
						<?php if($daoqi==1){ ?>
                    <p style="font-size: 14px;"> VIP有效期：<?=$huiyaundaoqi?></p>
					
					<?php } ?>
					
						<?php if($daoqi!=1){ ?>
                    <p style="font-size: 14px;"> 您现在还不是会员</p>
					
					<?php } ?>					
					
					
					
					
					
                </div>
                <div class="aui-flex-box-fr">
                <a href="#a">
                    <button class="qiandao">立即续费</button>
                </a>
                </div>
               
            </div>

        <div class="touxiang">
			<button onclick="new Function(demo1.innerHTML)();">成为会员每年可节省<span style="color: #ffa200; line-height: 5px;"><?=$rowb['dianji']?></span>元</button>
             <span id="demo1" style="display: none;">layer.open({
  content: '￥：<?=$rowb['dianji']?>'
  
  ,style: 'background-image:url(/ui/image/tcbg.png); color:#000; border:none;' //自定风格
  ,btn: ['']
});</span>
        </div>	
        <div class="H-flexbox-horizontal H-text-align-center H-theme-background-color-white background H-padding-vertical-both-10" style="padding-top: 45px;">
        <div class="H-flex-item" onclick="H.openWin('vipprevilege', 'vipprevilege.php')">
            <span class="H-icon H-center-all  H-border-radius-15 H-margin-horizontal-auto" style="height: 42px; width: 42px; "><img height="42px" width="42px" src="ui/image/fan.png"></span>
            <label class="H-display-block H-font-size-17 H-margin-vertical-top-5 H-theme-font-color4-active">购物返现</label>
            
        </div>
        <div class="H-flex-item" onclick="H.openWin('vipprevilege', 'vipprevilege.php')">
            <span class="H-icon H-center-all  H-border-radius-15 H-margin-horizontal-auto" style="height: 42px; width: 42px; "><img height="42px" width="42px" src="ui/image/hy.png"></span>
            <label class="H-display-block H-font-size-17 H-margin-vertical-top-5 H-theme-font-color4-active">会员积分</label>
            
        </div>
        <div class="H-flex-item" onclick="H.openWin('vipprevilege', 'vipprevilege.php')">
            <span class="H-icon H-center-all  H-border-radius-15 H-margin-horizontal-auto" style="height: 42px; width: 42px; "><img height="42px" width="42px" src="ui/image/jg.png"></span>
            <label class="H-display-block H-font-size-17 H-margin-vertical-top-5 H-theme-font-color4-active">会员专享价</label>
            
        </div>
        
    </div>
	<!-- vip等级续费 -->
                         <!-- v1 -->
    
	 <!-- v1 -->
        <div class="H-accordion-area">
            
                <ul style="width:90%"  id="ull">
                	 <span class="toubu">————G.S尊享会员————</span>
					 
					 
					 
		<?php	  
        $sql2 = "select * from tbl_taospp  where goodstype >3 AND vip_stage=1 order by id asc ";
        $query2=mysql_query($sql2);
		while ($row2=mysql_fetch_array($query2)) {     
    ?> 
					
                    <li value="<?=$row2['id']?>+<?=$row2['zswprice']?>" style="margin-top: 10px;">
                      <span style="margin-left: 20px;"><?=$row2['chtitle']?></span><br/>
					  <span class="H-theme-font-color-999  ">享会员专享价+赠双倍积分+购物返现<span style="color: #ffa200;font-size: 14px;font-weight: 600; margin-left: 2px;">2%</span></span><br/>
					  <span class="jiage">￥:<?=$row2['zswprice']?></span>
                    </li>

	  <?php } ?>		   
				   
                </ul> 
				
	           <input type="hidden" name="yue" id="yue" >
	           <input type="hidden" name="yueid" id="yueid" >			   
	           <input type="hidden" name="yueall" id="yueall"  value="<?=$rowa['yuee']?>">		
    </div>
<!-- v2 -->

<!-- v2 -->			
</br>	</br>
        
	</br>		</br>	</br>
    <a name="a"></a>		 
	       <div class="H-padding-10 H-border-vertical-bottom-after  H-theme-background-color-white H-flexbox-horizontal H-theme-font-color-999 H-font-size-14 H-footer H-flexbox-horizontal H-text-horizontal-left H-box-sizing-border-box" style="width:100%;height:60px;position:fixed;bottom:0px">               
               
                        <button onclick="H.swiperShare('.single-menu', '.share-menu', 'space');" class="H-button H-width-100-percent H-font-size-18 H-outline-none H-padding-vertical-both-7 H-padding-horizontal-both-17 H-theme-background-color8 H-theme-font-color-white H-theme-border-color8 H-theme-border-color8-click H-theme-background-color8-click H-theme-font-color8-click H-border-radius-3">立即加入</button>
                 
            </div>
	



	
			
    </div>
	
     <script type="text/javascript" src="/ui/js/jquery-2.0.3.min.js"></script> 
     <script type="text/javascript" src="/ui/script/H.js"></script>

    <div class="single-menu H-background-color-transparent-1 H-flexbox-vertical H-display-none-important H-position-absolute H-vertical-top-0 H-horizontal-left-0 H-horizontal-right-0 H-vertical-bottom-0 H-height-100-percent H-width-100-percent H-z-index-1000000">
        <div class="space H-flex-item"></div>
        <div class="share-menu">
            <div class="H-flexbox-horizontal H-text-align-center H-theme-background-color-white H-padding-vertical-both-10">	
			    <div class="H-padding-horizontal-both-10" style="width: 100%;">

		<div class="H-padding-vertical-bottom-10"></div>
		
        <button onclick="yueadd()" id="yuebutton" class="H-button H-width-100-percent  H-font-size-15 H-outline-none H-padding-vertical-both-12 H-padding-horizontal-both-20 H-theme-background-color8 H-theme-font-color-white H-theme-border-color8 H-theme-border-color8-click H-theme-background-color8-click H-theme-font-color8-click H-border-radius-3">可用余额</button>
		
        <button id="yuebutton1" style="display: none" class="H-button H-width-100-percent  H-font-size-15 H-outline-none H-padding-vertical-both-12 H-padding-horizontal-both-20 H-theme-background-color8 H-theme-font-color-white H-theme-border-color8 H-theme-border-color8-click H-theme-background-color8-click H-theme-font-color8-click H-border-radius-3">余额不足</button>		
		
		
        <div class="H-padding-vertical-bottom-10"></div>
		
							 <?php
		 
		 // 是否微信中打开
function is_weixin() {
   if (strpos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger') !== false) {
       return true;
    } return false;
 }
 $is_weixin = (is_weixin() == true) ? "1" : "2";	
 ?>	
  <?php
 if($is_weixin==1){
	 	?> 
		
        <button onclick="wxadd()" id="yuebutton"  class="H-button H-width-100-percent  H-font-size-15 H-outline-none H-padding-vertical-both-12 H-padding-horizontal-both-20 H-theme-background-color7 H-theme-font-color-white H-theme-border-color7 H-theme-border-color7-click H-theme-background-color7-click H-theme-font-color7-click H-border-radius-3">微信支付</button>
        <div class="H-padding-vertical-bottom-10"></div>
	  <?php } ?>	

			    </div>
            </div>
            <div tapmode="" onclick="H.swiperShare('.single-menu', '.share-menu', 'space');" class="H-theme-background-color-eee H-padding-12 H-font-size-16 H-center-all H-touch-active">关闭</div>
        </div>
    </div>

<script type="text/javascript">
　　$(function(){
　　$("#ull li").on("click",function(){  
　　var a=$(this).attr("value");  
			var d=a.split('+');
            var b=d[1];
            var c=d[0];;


    $("#yue").val(b);  
    $("#yueid").val(c);  	

    var allmoney = $("#yueall").val();	
	
	var allmoney1=parseInt(allmoney);
	
	if(allmoney1<b){
		
	$("#yuebutton").css("display","none");
	$("#yuebutton1").css("display","block");	
	
	}
　　});
　　});
</script>
<script type="text/javascript">
  function wxadd(){

    var goodidd = $("#yueid").val();
	if(goodidd==""){
		
	layer.open({
    content: '请先选择开通时间'
    ,skin: 'msg'
    ,time: 2 //2秒后自动关闭
  });	
	return false;	
	}
   window.location.href="gswxvip.php?moneyid="+goodidd; 

  }
</script>
<script type="text/javascript">
  function yueadd(){
    var goodid = $("#yue").val();
	if(goodid==""){
		
	layer.open({
    content: '请先选择开通时间'
    ,skin: 'msg'
    ,time: 2 //2秒后自动关闭
  });	
	return false;	
	}
	
	var pay_type='2';
	var uid = '<?=$_COOKIE['userid']?>';	

	goodsid	=$("#yueid").val();
		


	
    $.ajax({
        url: './yueviphd.php',
        type: 'POST',
        dataType: 'json',
        data: {goodsid: goodsid},
      })
	
    .done(function(respon) {
    if (respon.error==0) {
		
	    $.ajax({
        url: '/api/muyin/api.php?s=user.pay_vip_use_score',
        type: 'POST',
        dataType: 'json',
        data: {goodsid: goodsid,
		pay_type:pay_type,
		uid:uid
		
		},
      })	
		
		   .done(function(respon) {
		
	    if (respon.code==0) {	
		
		    $.ajax({
        url: './yuevipadd.php',
        type: 'POST',
        dataType: 'json',
        data: {goodsid: goodsid},
      })
		
	.done(function(respon) {	
	
	if (respon.error==0) {
	layer.open({
    content: '支付成功'
    ,btn: ['知道了']
    ,yes: function(index){
      location.reload();
      layer.close(index);
    }
  });
	
	
	
			   }
   })  		
		}
        })
  }
    })	
  }
</script>

     <script type="text/javascript">
        var ull = document.getElementById("ull");
        var li = ull.getElementsByTagName("li");
        ull.onclick = function(e){
            e = e || window.event;
            var target = e.srcElement || e.target;
            for(var i=0,len=li.length;i<len;i++){
                li[i].className = target == li[i] ? "liSelected":"";   
            }
        };
    </script>
</body>
</html>